NCTTextToAudio2Lib

NCTAudioStudio2 ActiveX DLLs
NCTTextToAudio2 ActiveX DLL

Version 2.2

NCTTextToAudio2 ActiveX DLL is a tool for conversion of text to voice.

With NCTTextToAudio2 you can convert any text from text file or string to voice (wav file or audio data).

You can insert NCTTextToAudio2 in your program, written on a language that supports ActiveX automation.

With NCTTextToAudio2 you can:

  • convert text from string to wav file (ConvertStringToWav)

  • convert text from text file to wav file (ConvertTextToWav)

  • convert text from string to audio data array (ConvertStringToArray)

  • convert text from text file to audio data array (ConvertTextToArray)

NCTTextToAudio2 is a part of the NCTAudioStudio2 package.

Send Feedback on the NCTTextToAudio2 documentation.
NCTTextToAudio2 was developed by NCT Company Ltd. http://www.nctsoft.com


TextToAudio2 properties

TextToAudio2 properties

Property | Type | Default | Description
AsyncMode | Boolean |  | Gets or sets a flag indicating if conversion is performed in asynchronous mode or not.
Channels | ChannelsConstants |  | Gets or sets the number of the output channels (mono or stereo) in output data.
ConversionPercent | Long |  | Read-only property that returns the percent of conversion, started by the following methods: ConvertStringToArray, ConvertStringToWav, ConvertTextToArray, ConvertTextToWav.
Frequency | FrequencyConstants |  | Gets or sets the frequency of audio array or wav file.
Rate | Long |  | Gets or sets the voice rate.
Status | Boolean |  | Read-only property that returns the status of the process (conversion or waiting).
VoiceAge | String |  | Read-only property that returns the age of the owner of this voice.
VoiceCount | Long |  | Read-only property that returns the number of voice types in the voice library.
VoiceGender | String |  | Read-only property that returns the gender of the owner of this voice.
VoiceLanguage | String |  | Read-only property that returns the language of the current voice.
VoiceName | String |  | Gets or sets the name of the current voice.
VoiceNum | Long |  | Gets or sets the number of the current voice.
VoiceVendor | String |  | Read-only property that returns the vendor of the current voice.
Volume | Long |  | Gets or sets the volume of the output audio array or audio file.


AsyncMode property (TextToAudio2)

NCTAudioCompress ActiveX DLL
AsyncMode property (TextToAudio2 object)

Gets or sets a flag indicating if conversion is performed in asynchronous mode or not.

Property type

A Boolean value.

Syntax

object.AsyncMode [= value]

The AsyncMode property syntax has these parts:

Part | Type | Description
object | TextToAudio2 | An expression evaluating to an object.
value | Boolean | True if conversion is performed in asynchronous mode, False if in synchronic mode. By default this property is set to True.

Remarks:

Conversion process, started by the following methods: ConvertStringToArray, ConvertStringToWav, ConvertTextToArray, ConvertTextToWav, can be performed either in synchronic mode or in asynchronous mode. In asynchronous mode after starting the method the run-time control passes to the program and the program gets info about the completion from EndOperation event.

See Also:

Channels | Frequency | Rate | Volume

Applies to: TextToAudio2

Send Feedback on the NCTAudioCompress documentation.
NCTAudioCompress was developed by NCT company http://www.nctsoft.com


Channels property (TextToAudio2)

Channels property (TextToAudio2)

Gets or sets the number of the output channels (mono or stereo) in output data.

Property type

A ChannelsConstants value.

Syntax

object.Channels [= value]

The Channels property syntax has these parts:

Part | Type | Description
object | TextToAudio2 | An expression evaluating to an object.
value | ChannelsConstants |

Remarks:

This property should be set before applying the following methods: ConvertStringToArray, ConvertTextToArray, ConvertStringToWav, ConvertTextToWav.

See Also:

AsyncMode | Frequency | Rate | Volume

Applies to: TextToAudio2


ConversionPercent property (TextToAudio2)

ConversionPercent property (TextToAudio2)

Read-only property that returns the percent of conversion, started by the following methods: ConvertStringToArray, ConvertStringToWav, ConvertTextToArray, ConvertTextToWav.

Property type

A Long value.

Syntax

value = object.ConversionPercent

The ConversionPercent property syntax has these parts:

Part | Type | Description
object | TextToAudio2 | An expression evaluating to an object.
value | Long | Conversion percent, from 0 to 100.

See Also:

Applies to: TextToAudio2


Frequency property (TextToAudio2)

Frequency property (TextToAudio2)

Gets or sets the frequency of audio array or wav file.

Property type

A FrequencyConstants value.

Syntax

object.Frequency [= value]

The Frequency property syntax has these parts:

Part | Type | Description
object | TextToAudio2 | An expression evaluating to an object.
value | FrequencyConstants | Frequency of audio array.

Remarks:

This property should be set before applying the following methods: ConvertStringToArray, ConvertTextToArray, ConvertStringToWav, ConvertTextToWav.

See Also:

AsyncMode | Channels | Rate | Volume

Applies to: TextToAudio2


Rate property (TextToAudio2)

Rate property (TextToAudio2)

Gets or sets the voice rate.

Property type

A Long value.

Syntax

object.Rate [= value]

The Rate property syntax has these parts:

Part | Type | Description
object | TextToAudio2 | An expression evaluating to an object.
value | Long | From -10 to +10. By default this value is set to 0.

Remarks:

This property should be set before applying the following methods: ConvertStringToArray, ConvertTextToArray, ConvertStringToWav, ConvertTextToWav.

See Also:

AsyncMode | Channels | Frequency Volume

Applies to: TextToAudio2


Status property (TextToAudio2)

Status property (TextToAudio2)

Read-only property that returns the status of the process (conversion or waiting).

Property type

A Boolean value.

Syntax

value = object.Status

The Status property syntax has these parts:

Part | Type | Description
object | TextToAudio2 | An expression evaluating to an object.
value | Boolean | This value can be True ( converting ) or False ( waiting)

Remarks:

When a user runs ConvertStringToArray, ConvertTextToArray, ConvertStringToWav or ConvertTextToWav method, it runs in separate process. The user always can inquire about the status of this process (Status method). Status can be conversion or waiting.

See Also:

Applies to: TextToAudio2


VoiceAge property (TextToAudio2)

VoiceAge property (TextToAudio2)

Read-only property that returns the age of the owner of this voice.

Property type

A String value.

Syntax

value = object.VoiceAge

The VoiceAge property syntax has these parts:

Part | Type | Description
object | TextToAudio2 | An expression evaluating to an object.
value | String | A value.

See Also:

VoiceCount | VoiceGender | VoiceLanguage | VoiceName | VoiceNum | VoiceVendor

Applies to: TextToAudio2


VoiceCount property (TextToAudio2)

VoiceCount property (TextToAudio2)

Read-only property that returns the number of voice types in the voice library.

Property type

A Long value.

Syntax

value = object.VoiceCount

The VoiceCount property syntax has these parts:

Part | Type | Description
object | TextToAudio2 | An expression evaluating to an object.
value | Long | The number of voice.

See Also:

VoiceAge | VoiceGender | VoiceLanguage | VoiceName | VoiceNum | VoiceVendor

Applies to: TextToAudio2


VoiceGender property (TextToAudio2)

VoiceGender property (TextToAudio2)

Read-only property that returns the gender of the owner of this voice.

Property type

A String value.

Syntax

value = object.VoiceGender

The VoiceGender property syntax has these parts:

Part | Type | Description
object | TextToAudio2 | An expression evaluating to an object.
value | String | Can be or "male" or "female".

See Also:

VoiceAge | VoiceCount | VoiceLanguage | VoiceName | VoiceNum | VoiceVendor

Applies to: TextToAudio2


VoiceLanguage property (TextToAudio2)

VoiceLanguage property (TextToAudio2)

Read-only property that returns the language of the current voice.

Property type

A String value.

Syntax

value = object.VoiceLanguage

The VoiceLanguage property syntax has these parts:

Part | Type | Description
object | TextToAudio2 | An expression evaluating to an object.
value | String |

See Also:

VoiceAge | VoiceCount | VoiceGender | VoiceName | VoiceNum | VoiceVendor

Applies to: TextToAudio2


VoiceName property (TextToAudio2)

VoiceName property (TextToAudio2)

Gets or sets the name of the current voice.

Property type

A String value.

Syntax

object.VoiceName [= value]

The VoiceName property syntax has these parts:

Part | Type | Description
object | TextToAudio2 | An expression evaluating to an object.
value | String | The name of voice.

See Also:

VoiceAge | VoiceCount | VoiceGender | VoiceLanguage | VoiceNum | VoiceVendor

Applies to: TextToAudio2


VoiceNum property (TextToAudio2)

VoiceNum property (TextToAudio2)

Gets or sets the number of the current voice.

Property type

A Long value.

Syntax

object.VoiceNum [= value]

The VoiceNum property syntax has these parts:

Part | Type | Description
object | TextToAudio2 | An expression evaluating to an object.
value | Long | Varies from 0 to (VoiceCount - 1 )

Remarks:

This property should be set before applying the following methods: ConvertStringToArray, ConvertTextToArray, ConvertStringToWav, ConvertTextToWav.

See Also:

VoiceAge | VoiceCount | VoiceGender | VoiceLanguage | VoiceName | VoiceVendor

Applies to: TextToAudio2


VoiceVendor property (TextToAudio2)

VoiceVendor property (TextToAudio2)

Read-only property that returns the vendor of the current voice.

Property type

A String value.

Syntax

value = object.VoiceVendor

The VoiceVendor property syntax has these parts:

Part | Type | Description
object | TextToAudio2 | An expression evaluating to an object.
value | String | The vendor of the voice.

See Also:

VoiceAge | VoiceCount | VoiceGender | VoiceLanguage | VoiceName | VoiceNum

Applies to: TextToAudio2


Volume property (TextToAudio2)

Volume property (TextToAudio2)

Gets or sets the volume of the output audio array or audio file.

Property type

A Long value.

Syntax

object.Volume [= value]

The Volume property syntax has these parts:

Part | Type | Description
object | TextToAudio2 | An expression evaluating to an object.
value | Long | Can take values from 0 to 100.

Remarks:

This property should be set before applying the following methods: ConvertStringToArray, ConvertTextToArray, ConvertStringToWav, ConvertTextToWav. Volume is specified as a percentage of the maximum volume for the current voice. Different voices can have different maximum volume levels.

See Also:

AsyncMode | Channels | Frequency | Rate

Applies to: TextToAudio2


TextToAudio2 methods

TextToAudio2 methods

Method | Description
CancelConvert | Stops conversion process.
ConvertStringToArray | Starts conversion from string to audio data array.
ConvertStringToWav | Starts conversion from string to wav file.
ConvertTextToArray | Starts conversion from a text file to audio data array.
ConvertTextToWav | Starts conversion from a text file to wav file.
GetAudioArray | Gets output audio data array.
Register | Enters user name and registration password to disable About window.
SetFormatArray | Sets the format of audio data. Audio data is an Integer array in the PCM format.


CancelConvert method

CancelConvert method

Stops conversion process.

Syntax

object.CancelConvert

The CancelConvert method syntax has these parts:

Part | Type | Description
object | TextToAudio2 | An expression evaluating to an object.

Remarks:

When a user runs ConvertStringToArray, ConvertTextToArray, ConvertStringToWav or ConvertTextToWav method, it runs in an individual process. The user always cans inquire about the status of this process (Status property). Status can be conversion or waiting. The user can also stop this conversion process.

See Also:

Applies to: TextToAudio2


ConvertStringToArray method

ConvertStringToArray method

Starts conversion from string to audio data array.

Syntax

object.ConvertStringToArray(txtString As String)

The ConvertStringToArray method syntax has these parts:

Part

Type

Description

object

TextToAudio2

An expression evaluating to an object .

txtString

String

The input string.

Remarks:

Before applying this method, the following properties should be set: Frequrency, Rate, VoiceName or VoiceNum, Volume, Channels.

This method can be performed either in synchronic or in asynchronic mode (see AsyncMode property). In the latter case after completing of conversion EndOperation event occurs.

To get audio array after conversion you can use GetAudioArray method.

See Also:

ConvertStringToWav | ConvertTextToArray | ConvertTextToWav

Applies to: TextToAudio2


ConvertStringToWav method

ConvertStringToWav method

Starts conversion from string to wav file.

Syntax

object.ConvertStringToWav(txtString As String, wavFileName As String, nBitsPerSample As BitsPerSampleConstants)

The ConvertStringToWav method syntax has these parts:

Part | Type | Description
object | TextToAudio2 | An expression evaluating to an object.
txtString | String | The input string.
wavFileName | String | The name of the output wav file.
nBitsPerSample | BitsPerSampleConstants | Number of bits per sample.

Remarks:

Before applying this method, the following properties should be set: Frequrency, Rate, VoiceName or VoiceNum, Volume, Channels.

This method can be performed either in synchronic or in asynchronic mode (see AsyncMode property). In the latter case after completing of conversion EndOperation event occurs.

See Also:

ConvertStringToArray | ConvertTextToArray | ConvertTextToWav

Applies to: TextToAudio2


ConvertTextToArray method

ConvertTextToArray method

Starts conversion from a text file to audio data array.

Syntax

object.ConvertTextToArray(txtFileName As String)

The ConvertTextToArray method syntax has these parts:

Part | Type | Description
object | TextToAudio2 | An expression evaluating to an object.
txtFileName | String | The name of the input text file.

Remarks:

Before applying this method, the following properties should be set: Frequrency, Rate, VoiceName or VoiceNum, Volume, Channels.

This method can be performed either in synchronic or in asynchronic mode (see AsyncMode property). In the latter case after completing of conversion EndOperation event occurs.

To get audio array after conversion you can use GetAudioArray method.

See Also:

ConvertStringToArray | ConvertStringToWav | ConvertTextToWav

Applies to: TextToAudio2


ConvertTextToWav method

ConvertTextToWav method

Starts conversion from a text file to wav file.

Syntax

object.ConvertTextToWav(txtFileName As String, wavFileName As String, nBitsPerSample As BitsPerSampleConstants)

The ConvertTextToWav method syntax has these parts:

Part | Type | Description
object | TextToAudio2 | An expression evaluating to an object.
txtFileName | String | The name of the input text file.
wavFileName | String | The name of the output wav file.
nBitsPerSample | BitsPerSampleConstants | Number of bits per sample.

Remarks:

Before applying this method, the following properties should be set: Frequrency, Rate, VoiceName or VoiceNum, Volume, Channels.

This method can be performed either in synchronic or in asynchronous mode (see AsyncMode property). In the latter case after completing of conversion EndOperation event occurs.

See Also:

ConvertStringToArray | ConvertStringToWav | ConvertTextToArray

Applies to: TextToAudio2


GetAudioArray method

GetAudioArray method

Gets output audio data array.

Return Type

A Integer() value.

Syntax

AudioArray = object.GetAudioArray()

The GetAudioArray method syntax has these parts:

Part | Type | Description
object | TextToAudio2 | An expression evaluating to an object.
AudioArray | Integer() | This array contains output audio data.

Remarks:

This method can be applied only after the following methods: ConvertStringToArray or ConvertTextToArray .

See Also:

Applies to: TextToAudio2


Register method

Register method

Enters user name and registration password to disable About window.

Syntax

object.Register(bstrUser As String, bstrPassword As String)

The Register method syntax has these parts:

Part | Type | Description
object | TextToAudio2 | An expression evaluating to an object of type .
bstrUser | String | User name. You get a registration user name after the registration.
bstrPassword | String | Password string. You get a registration password after the registration.

See Also:

Applies to: TextToAudio2


SetFormatArray method

NCTTextToAudio ActiveX DLL
SetFormatArray method (TextToAudio2 object)

Sets the format of audio data. Audio data is an Integer array in the PCM format.

Syntax

object.SetFormatArray(Frequency As FrequencyConstants, Channels As ChannelsConstants)

The SetFormatArray method syntax has these parts:

Part | Type | Description
object | TextToAudio2 | An expression evaluating to an object.
Frequency | FrequencyConstants | Frequency of an audio file. By default the Frequency is equal to FQ_44_KHZ.
Channels | ChannelsConstants | Number of channels of an audio file. By default the nChannels is equal to STEREO.

See Also:

Applies to: TextToAudio2

Send Feedback on the NCTTextToAudio documentation.
NCTTextToAudio was developed by NCT company http://www.nctsoft.com


TextToAudio2 events

TextToAudio2 events

Event | Description
ConvertBlock | Occurs when conversion of the block is completed, after starting the following methods: ConvertStringToArray, ConvertStringToWav, ConvertTextToArray, ConvertTextToWav.
EndConvert | Occurs when conversion from text to audio is completed.


ConvertBlock event

ConvertBlock event

Occurs when conversion of the block is completed, after starting the following methods: ConvertStringToArray, ConvertStringToWav, ConvertTextToArray, ConvertTextToWav.

Syntax

Sub object_ConvertBlock(Percent As Long)

The ConvertBlock event syntax has these named arguments:

Part | Type | Description
Percent | Long | Conversion percent, from 0 to 100.

See Also:

EndConvert

Applies to: TextToAudio2


EndConvert event

EndConvert event

Occurs when conversion from text to audio is completed.

Syntax

Sub object_EndConvert()

See Also:

ConvertBlock

Applies to: TextToAudio2


NCTTextToAudio2 constants

NCTTextToAudio2 constants

Constants | Description
BitsPerSampleConstants | These are the constants for the following methods: ConvertStringToWav method, ConvertTextToWav method.
ChannelsConstants | These are the constants for the following method and property: SetFormatArray method, Channels property (TextToAudio2).
FrequencyConstants | These are the constants for the following method and property: SetFormatArray method, Frequency property (TextToAudio2).


BitsPerSampleConstants enumeration

BitsPerSampleConstants enumeration

These are the constants for the following methods: ConvertStringToWav method, ConvertTextToWav method.

Members

Constant | Value | Description
BPS_2_BIT | 2 | 2 bits per sample.
BPS_3_BIT | 3 | 3 bits per sample.
BPS_4_BIT | 4 | 4 bits per sample.
BPS_5_BIT | 5 | 5 bits per sample.
BPS_8_BIT | 8 | 8 bits per sample.
BPS_16_BIT | 16 | 16 bits per sample.
BPS_24_BIT | 24 | 24 bits per sample.
BPS_32_BIT | 32 | 32 bits per sample.


ChannelsConstants enumeration

ChannelsConstants enumeration

These are the constants for the following method and property: SetFormatArray method, Channels property (TextToAudio2).

Members

Constant | Value | Description
MONO | 1 | Mono data uses one channel.
STEREO | 2 | Stereo data uses two channels.


FrequencyConstants enumeration

FrequencyConstants enumeration

These are the constants for the following method and property: SetFormatArray method, Frequency property (TextToAudio2).

Members

Constant | Value | Description
FQ_96_KHZ | 96000 | 96000 hertz.
FQ_88_KHZ | 88200 | 88200 hertz.
FQ_48_KHZ | 48000 | 48000 hertz.
FQ_44_KHZ | 44100 | 44100 hertz.
FQ_32_KHZ | 32000 | 32000 hertz.
FQ_24_KHZ | 24000 | 24000 hertz.
FQ_22_KHZ | 22050 | 22050 hertz.
FQ_16_KHZ | 16000 | 16000 hertz.
FQ_12_KHZ | 12000 | 12000 hertz.
FQ_11_KHZ | 11025 | 11025 hertz.
FQ_8_KHZ | 8000 | 8000 hertz.
FQ_6_KHZ | 6000 | 6000 hertz.


NCTTextToAudio2Lib

NCTAudioStudio2 ActiveX DLLs

Version 2.2

NCTTextToAudio2 ActiveX DLL is a tool for conversion text to voice.

With NCTTextToAudio2 you can convert any text from text file or string to voice (wav file or audio data).

You can insert NCTTextToAudio2 in your program, written on the language, which supports ActiveX automation.

With NCTTextToAudio2 you can:

  • convert text from string to wav file (ConvertStringToWav)

  • convert text from text file to wav file (ConvertTextToWav)

  • convert text from string to audio data array (ConvertStringToArray)

  • convert text from text file to audio data array (ConvertTextToArray)

NCTTextToAudio2 is a part of the NCTAudioStudio2 package.


ConvertAsynchronous property (TextToAudio2)

AsyncMode property (TextToAudio2)

Gets or sets a flag indicating if conversion is performed in asynchronous mode mode or not.

Property type

A Boolean value.

Syntax

object.AsyncMode [= value]

The AsyncMode property syntax has these parts:

Part | Type | Description
object | TextToAudio2 | An expression evaluating to an object.
value | Boolean | True if conversion is performed in asynchronic mode, False if in synchronic mode. By default this property is set to True.

Remarks:

Conversion process, started by the following methods: ConvertStringToArray, ConvertStringToWav, ConvertTextToArray, ConvertTextToWav, can be performed either in synchronic mode or in asynchronous mode. In asynchronous mode after starting of method run-time control passes to program and program get info about completion from EndOperation event.

See Also:

Applies to: TextToAudio2


EndOperation event

EndOperation event

Occurs when conversion from text to audio is completed.

Syntax

Sub object_EndOperation()

See Also:

Applies to: TextToAudio2